<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>AngularJs</title>
		<script type="text/javascript" src="../js/angular.min.js"></script>
	</head>
	<body ng-app="myapp" ng-controller="myctrl">
		<div>
			<input type="text" name="name" ng-model="name" />
		</div>
		<div>
			<!-- {{}} 相当于ng-bind 用于数据显示 -->
			hello,{{name}}
			<!--<p ng-bind="name"></p>-->
		</div>
		
		<script type="text/javascript">
			// 初始化myapp 模块
			var myapp = angular.module("myapp",[]);
			// 定义模块的控制器
			// 依赖注入,$scope作用域对象,操作当前作用域范围
			myapp.controller("myctrl",["$scope",function($scope){
				// 对模型初始化赋值
				$scope.name = "黑马程序员";
			}]);
		</script>
	</body>
</html>
